package com.guoranhao.tool.vo;

import java.io.Serializable;
import java.util.List;

/**
 * Description: admin 返回 total + list 实体
 * Copyright (c) Department of Research and Development/Beijing
 * All Rights Reserved.
 * @version 1.0 2019-01-25 11:58 by 宫珣（gongxun@cloud-young.com/）创建
 */
public class AdminResultVo<T>  implements Serializable{

    private static final long serialVersionUID = 5600423646781747934L;

    /**
     * 总数
     * Description:
     */
    private Integer total;

    /**
     * list
     */
    private List<T> rows;

    /**
     * Instantiates a new Admin result vo.
     */
    public AdminResultVo() {

    }
    /**
     * Instantiates a new Admin result vo.
     *
     * @param total the total
     * @param rows  the list
     */
    public AdminResultVo(Integer total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }

    /**
     * Builder builder.
     *
     * @param <T> the type parameter
     * @return the builder
     */
    public static <T> Builder<T> builder() {
        return new Builder<>();
    }

    /**
     * Gets total.
     *
     * @return the total
     */
    public Integer getTotal() {
        return this.total;
    }

    /**
     * Gets list.
     *
     * @return the list
     */
    public List<T> getRows() {
        return this.rows;
    }

    /**
     * Sets total.
     *
     * @param total the total
     */
    public void setTotal(Integer total) {
        this.total = total;
    }

    /**
     * Sets list.
     *
     * @param rows the list
     */
    public void setRows(List<T> rows) {
        this.rows = rows;
    }


    /**
     * The type Builder.
     *
     * @param <T> the type parameter
     */
    public static class Builder<T> {

        /**
         * 总数
         */
        private Integer total;

        /**
         * list
         */
        private List<T> list;

        /**
         * Instantiates a new Builder.
         */
        public Builder() {
        }

        /**
         * Total builder.
         *
         * @param total the total
         * @return the builder
         */
        public Builder<T> total(Integer total) {
            this.total = total;
            return this;
        }

        /**
         * List builder.
         *
         * @param list the list
         * @return the builder
         */
        public Builder<T> list(List<T> list) {
            this.list = list;
            return this;
        }

        /**
         * Build admin result vo.
         *
         * @return the admin result vo
         */
        public AdminResultVo<T> build() {
            return new AdminResultVo<>(this.total, this.list);
        }


    }



}
